from concurrent.futures import ProcessPoolExecutor as ppe
import os,time,random
import Env.EnvMain as env
import numpy as np
import time

def First_step_strategy():      # FirstStep的策略
    strategy=[]
    select=np.random.randint(0,120)
    strategy.append([0,select])
    return strategy

def do(fun,n):
    fun.reset()
    # fun.FirstStep(First_step_strategy())
    # for i in range(1000):
    #     fun.step([[[-0.1,-0.17]], [[0]]])
    #     print(str(n)+":"+str(i))


if __name__=='__main__':
    p=ppe()
    envs=[]
    l=[]
    # for i in range(8):
    #     envs.append(env.ACEnv(1,1,index=i))
    for i in range(8):
        obj=p.submit(env.ACEnv,1,1,index=i)
        l.append(obj)
    print([obj.result() for obj in l])
    envs[0].FirstStep(First_step_strategy())

    # for j in range(8):
    #     obj = p.submit(envs[j].FirstStep, First_step_strategy())
    #     l.append(obj)
    # print([obj.result() for obj in l])

    for i in range(100):
        pass


